package mcts

import (
	"bindolabs/gomoku/modules/gomoku_env"
	"math/rand"
)

func (node *MCTSNode) BestAction(actions []*gomoku_env.Action) *gomoku_env.Action {
	// 假设有一个启发式评估函数 EvaluateAction
	bestAction := actions[0]
	bestValue := EvaluateAction(actions[0])
	for _, action := range actions[1:] {
		value := EvaluateAction(action)
		if value > bestValue {
			bestAction = action
			bestValue = value
		}
	}
	return bestAction
}

func EvaluateAction(action *gomoku_env.Action) float64 {
	// 实现具体的启发式评估逻辑
	return rand.Float64() // 示例：随机返回一个浮点数作为评估值
}
